<!DOCTYPE html>
<html lang="en">
<head>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
</head>
<body>
    <div id="app1">
        <my-com></my-com>
    </div>
    <div id="app2">
        <my-com></my-com>
    </div>
    <template id="app2-com">
        <h4>app2中注册的局部组件</h4>
    </template>
    <script>
        var app1=new Vue({
            el:'#app1',
        })
        var app2=new Vue({
            el:'#app2',
            components:{
                'my-com':{
                    template:'#app2-com'
                }
            }
        });
    </script>
 
</body>
</html>